<template>
  <el-dialog
    :title="dialogParam.title"
    :visible.sync="centerDialogVisible"
    :width="dialogParam.width"
    @open="dialogOpenBefore"
    :modal="dialogParam.isModal == null ? true: dialogParam.isModal"
    >
    <slot>

    </slot>
    <span slot="footer" class="dialog-footer" v-if="dialogParam.showFooter == null ? true: dialogParam.showFooter">
        <el-button @click="centerDialogVisible = false" size="mini">取 消</el-button>
        <el-button type="primary" @click="dialogCloseBefore"  size="mini" aria-label="Close">确 定</el-button>
  </span>
  </el-dialog>
</template>
<style>

</style>
<script>
  export default {
    props: ['dialogParam'],
    data () {
      return {
        centerDialogVisible: false
      }
    },
    methods: {
      openDialog () {
        this.centerDialogVisible = true
      },
      closeDialog () {
        this.centerDialogVisible = false
      },
      dialogOpenBefore () {
        this.$emit('dialogOpenBefore')
      },
      dialogCloseBefore () {
        this.$emit('dialogCloseBefore')
      }
    }
  }
</script>
